3.2.26 \(\int \frac {\cos (c+d x) (A+C \sec ^2(c+d x))}{a+a \sec (c+d x)} \, dx\) [126]

Optimal. Leaf size=52 \[ -\frac {A x}{a}+\frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))} \]

[Out]

-A*x/a+(2*A+C)*sin(d*x+c)/a/d-(A+C)*sin(d*x+c)/d/(a+a*sec(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4170, 3872, 2717, 8} \begin {gather*} \frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}-\frac {A x}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]*(A + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

-((A*x)/a) + ((2*A + C)*Sin[c + d*x])/(a*d) - ((A + C)*Sin[c + d*x])/(d*(a + a*Sec[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 4170

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b
_.) + (a_))^(m_), x_Symbol] :> Simp[(-a)*(A + C)*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(a*f*
(2*m + 1))), x] + Dist[1/(a*b*(2*m + 1)), Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n*Simp[b*C*n + A*b
*(2*m + n + 1) - (a*(A*(m + n + 1) - C*(m - n)))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, C, n}, x
] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x) \left (A+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \cos (c+d x) (-a (2 A+C)+a A \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {A \int 1 \, dx}{a}+\frac {(2 A+C) \int \cos (c+d x) \, dx}{a}\\ &=-\frac {A x}{a}+\frac {(2 A+C) \sin (c+d x)}{a d}-\frac {(A+C) \sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(108\) vs. \(2(52)=104\).
time = 0.31, size = 108, normalized size = 2.08 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-2 A d x \cos \left (\frac {d x}{2}\right )-2 A d x \cos \left (c+\frac {d x}{2}\right )+5 A \sin \left (\frac {d x}{2}\right )+4 C \sin \left (\frac {d x}{2}\right )+A \sin \left (c+\frac {d x}{2}\right )+A \sin \left (c+\frac {3 d x}{2}\right )+A \sin \left (2 c+\frac {3 d x}{2}\right )\right )}{4 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]*(A + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

(Sec[c/2]*Sec[(c + d*x)/2]*(-2*A*d*x*Cos[(d*x)/2] - 2*A*d*x*Cos[c + (d*x)/2] + 5*A*Sin[(d*x)/2] + 4*C*Sin[(d*x
)/2] + A*Sin[c + (d*x)/2] + A*Sin[c + (3*d*x)/2] + A*Sin[2*c + (3*d*x)/2]))/(4*a*d)

________________________________________________________________________________________

Maple [A]
time = 0.60, size = 73, normalized size = 1.40

method result size
derivativedivides \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 A \left (-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{d a}\) \(73\)
default \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 A \left (-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{d a}\) \(73\)
risch \(-\frac {A x}{a}-\frac {i A \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) \(93\)
norman \(\frac {\frac {A x}{a}+\frac {\left (A +C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {2 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {A x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\left (3 A +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(120\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(A*tan(1/2*d*x+1/2*c)+C*tan(1/2*d*x+1/2*c)-4*A*(-1/2*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^2)+1/2*arc
tan(tan(1/2*d*x+1/2*c))))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (52) = 104\).
time = 0.51, size = 117, normalized size = 2.25 \begin {gather*} -\frac {A {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - \frac {C \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

-(A*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - 2*sin(d*x + c)/((a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)
*(cos(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1))) - C*sin(d*x + c)/(a*(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 4.27, size = 53, normalized size = 1.02 \begin {gather*} -\frac {A d x \cos \left (d x + c\right ) + A d x - {\left (A \cos \left (d x + c\right ) + 2 \, A + C\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

-(A*d*x*cos(d*x + c) + A*d*x - (A*cos(d*x + c) + 2*A + C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {A \cos {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)**2)/(a+a*sec(d*x+c)),x)

[Out]

(Integral(A*cos(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*cos(c + d*x)*sec(c + d*x)**2/(sec(c + d*x) + 1),
x))/a

________________________________________________________________________________________

Giac [A]
time = 0.44, size = 74, normalized size = 1.42 \begin {gather*} -\frac {\frac {{\left (d x + c\right )} A}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

-((d*x + c)*A/a - (A*tan(1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a - 2*A*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x
 + 1/2*c)^2 + 1)*a))/d

________________________________________________________________________________________

Mupad [B]
time = 2.60, size = 59, normalized size = 1.13 \begin {gather*} \frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {A\,x}{a}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+C\right )}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)*(A + C/cos(c + d*x)^2))/(a + a/cos(c + d*x)),x)

[Out]

(2*A*tan(c/2 + (d*x)/2))/(d*(a + a*tan(c/2 + (d*x)/2)^2)) - (A*x)/a + (tan(c/2 + (d*x)/2)*(A + C))/(a*d)

________________________________________________________________________________________